package com.campus.backend.vo.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单VO
 *
 * @author ZhaoYuJie
 * @since 2025-01-20
 */
@Data
@ApiModel(value = "订单VO", description = "订单信息")
public class OrderVo {
    
    @ApiModelProperty("订单ID")
    private String id;
    
    @ApiModelProperty("用户ID")
    private Integer userId;
    
    @ApiModelProperty("顾客电话")
    private String customerPhone;
    
    @ApiModelProperty("商户ID")
    private Integer merchantId;
    
    @ApiModelProperty("商户名称")
    private String merchantName;
    
    @ApiModelProperty("商户Logo")
    private String merchantLogo;
    
    @ApiModelProperty("商户电话")
    private String merchantPhone;
    
    @ApiModelProperty("配送员ID")
    private Integer deliveryId;
    
    @ApiModelProperty("配送员电话")
    private String deliveryPhone;
    
    @ApiModelProperty("状态：1-待付款，2-待接单，3-进行中，4-已完成，5-已取消")
    private Integer status;
    
    @ApiModelProperty("状态文本")
    private String statusText;
    
    @ApiModelProperty("商家进度：0-待接单，1-备餐中，2-已出餐")
    private Integer merchantProcess;
    
    @ApiModelProperty("商家进度文本")
    private String merchantProcessText;
    
    @ApiModelProperty("配送员进度：0-待抢单，1-待取餐，2-配送中，3-已送达")
    private Integer deliveryProcess;
    
    @ApiModelProperty("配送员进度文本")
    private String deliveryProcessText;
    
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    
    @ApiModelProperty("支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime payTime;
    
    @ApiModelProperty("配送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime deliveryTime;
    
    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime finishTime;
    
    @ApiModelProperty("取消时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime cancelTime;
    
    @ApiModelProperty("商品总价")
    private BigDecimal totalPrice;
    
    @ApiModelProperty("原价")
    private BigDecimal originalPrice;
    
    @ApiModelProperty("配送费")
    private BigDecimal deliveryFee;
    
    @ApiModelProperty("总打包费（商品打包费累加）")
    private BigDecimal totalPackagingFee;
    
    @ApiModelProperty("优惠金额")
    private BigDecimal discount;
    
    @ApiModelProperty("实付金额")
    private BigDecimal actualPay;
    
    @ApiModelProperty("配送类型：1-外卖，2-堂食，3-自取")
    private Integer deliveryType;

    @ApiModelProperty("收货人姓名")
    private String receiverName;

    @ApiModelProperty("收货人电话")
    private String receiverPhone;

    @ApiModelProperty("配送地址")
    private String deliveryAddress;
    
    @ApiModelProperty("备注")
    private String remark;
    
    @ApiModelProperty("支付方式ID")
    private Integer paymentMethodId;
    
    @ApiModelProperty("使用的用户优惠券表ID")
    private Integer userCouponId;
    
    @ApiModelProperty("使用的积分")
    private Integer pointsUsed;
    
    @ApiModelProperty("积分抵扣金额")
    private BigDecimal pointsDiscount;
    
    @ApiModelProperty("订单商品列表")
    private List<OrderGoodsVo> goods;
    
    @Data
    @ApiModel("订单商品VO")
    public static class OrderGoodsVo {
        @ApiModelProperty("商品ID")
        private Integer id;
        @ApiModelProperty("商品名称")
        private String name;
        @ApiModelProperty("商品图片")
        private String image;
        @ApiModelProperty("商品规格（JSON字符串）")
        private String specifications;
        @ApiModelProperty("商品单价")
        private BigDecimal price;
        @ApiModelProperty("购买数量")
        private Integer quantity;
        @ApiModelProperty("商品总价")
        private BigDecimal totalPrice;
    }
}